#include "Evas.h"
#include "Ender.h"
#include "efl_ender_evas.h"
/*============================================================================*
 *                                  Local                                     *
 *============================================================================*/
/*----------------------------------------------------------------------------*
 *                           The Ender interface                              *
 *----------------------------------------------------------------------------*/
static void _evas_object_x_get(Evas_Object *o, int *x)
{
	evas_object_geometry_get(o, x, NULL, NULL, NULL);
}

static void _evas_object_x_set(Evas_Object *o, int x)
{
	int y;
	evas_object_geometry_get(o, NULL, &y, NULL, NULL);
	evas_object_move(o, x, y);
}

static void _evas_object_y_get(Evas_Object *o, int *y)
{
	evas_object_geometry_get(o, NULL, y, NULL, NULL);
}

static void _evas_object_y_set(Evas_Object *o, int y)
{
	int x;
	evas_object_geometry_get(o, &x, NULL, NULL, NULL);
	evas_object_move(o, x, y);
}

static void _evas_object_width_get(Evas_Object *o, int *w)
{
	evas_object_geometry_get(o, NULL, NULL, w, NULL);
}

static void _evas_object_width_set(Evas_Object *o, int w)
{
	int h;
	evas_object_geometry_get(o, NULL, NULL, NULL, &h);
	evas_object_resize(o, w, h);
}

static void _evas_object_height_get(Evas_Object *o, int *h)
{
	evas_object_geometry_get(o, NULL, NULL, NULL, h);
}

static void _evas_object_height_set(Evas_Object *o, int h)
{
	int w;
	evas_object_geometry_get(o, NULL, NULL, &w, NULL);
	evas_object_resize(o, w, h);
}

static void _evas_object_visible_set(Evas_Object *o, Eina_Bool visible)
{
	if (visible)
		evas_object_show(o);
	else
		evas_object_hide(o);
}

static void _evas_object_visible_get(Evas_Object *o, Eina_Bool *visible)
{
	*visible = evas_object_visible_get(o);
}

#define EVAS_OBJECT_X EFL_ENDER_EVAS_OBJECT_X
#define EVAS_OBJECT_Y EFL_ENDER_EVAS_OBJECT_Y
#define EVAS_OBJECT_WIDTH EFL_ENDER_EVAS_OBJECT_WIDTH
#define EVAS_OBJECT_HEIGHT EFL_ENDER_EVAS_OBJECT_HEIGHT
#define EVAS_OBJECT_VISIBLE EFL_ENDER_EVAS_OBJECT_VISIBLE
#define evas_namespace_get efl_ender_evas_namespace_get
#define _evas_object_delete evas_object_del
#include "efl_ender_evas_object_generated.c"
/*============================================================================*
 *                                 Global                                     *
 *============================================================================*/
void efl_ender_evas_object_init(void)
{
	_evas_object_init();
}
/*============================================================================*
 *                                   API                                      *
 *============================================================================*/
Ender_Property *EFL_ENDER_EVAS_OBJECT_X = NULL;
Ender_Property *EFL_ENDER_EVAS_OBJECT_Y = NULL;
Ender_Property *EFL_ENDER_EVAS_OBJECT_WIDTH = NULL;
Ender_Property *EFL_ENDER_EVAS_OBJECT_HEIGHT = NULL;
Ender_Property *EFL_ENDER_EVAS_OBJECT_VISIBLE = NULL;

